<?php

$m	= Array(
lang('january')
,lang('february')
,lang('march')
,lang('april')
,lang('may')
,lang('june')
,lang('july')
,lang('august')
,lang('september')
,lang('october')
,lang('november')
,lang('december')
);
?>
<form action="<?php echo site_url($this->config->item('admin_folder')."/reports/sales_excel")?>" method="post">
<p align="right"><input class="btn btn-primary" type="submit" value="Xuất excel"/></p>
<table class="table table-striped">
	<thead>
		<tr>
			<?php /*<th>ID</th> uncomment this if you want it*/ ?>
			<th><?php echo lang('date');?></th>
			<th><?php echo lang('coupon_discounts');?></th>
			<th><?php echo lang('gift_card_discounts');?></th>
			<th><?php echo lang('products');?></th>
			<th><?php echo lang('shipping');?></th>
			<th>Số tiền trừ(Quy đổi từ điểm khách hang)</th>
			<th><?php echo lang('grand_total');?></th>
		</tr>
	</thead>
	<tbody>
<?php foreach($orders as $month=>$item):?>
		<tr>
			<td><?php echo $month.'/'.$year;?></td>
			<td><?php echo format_currency($item["coupon_discount"]);?></td>
			<td><?php echo format_currency($item["gift_card_discount"]);?></td>
			<td><?php echo format_currency($item["subtotal"]);?></td>
			<td><?php echo format_currency($item["shipping"]);?></td>
			<td><?php echo format_currency($item["price_score"]);?></td>
			<td><?php echo format_currency($item["grand_total"]);?></td>
		</tr>
        <input type="hidden" name="report_month_year[<?php echo $month?>]" value='<?php echo json_encode(array(
										"coupon_discount"=>$item["coupon_discount"],
										"gift_card_discount"=>$item["gift_card_discount"],
										"subtotal"=>$item["subtotal"],
										"shipping"=>$item["shipping"],
										'price_score'=>$item["price_score"],
										"grand_total"=>$item["grand_total"],
									))?>'/>
<?php endforeach;?>
	</tbody>
</table>

</form>

